home *** CD-ROM | disk | FTP | other *** search
/ kermit.columbia.edu / kermit.columbia.edu.tar / kermit.columbia.edu / newsgroups / misc.19990725-20000114 / 000209_news@columbia.edu _Mon Oct 18 00:56:29 1999.msg < prev    next >
Internet Message Format  |  2000-01-13  |  3KB

  1. Return-Path: <news@columbia.edu>
  2. Received: from newsmaster.cc.columbia.edu (newsmaster.cc.columbia.edu [128.59.59.30])
  3.     by watsun.cc.columbia.edu (8.8.5/8.8.5) with ESMTP id AAA19217
  4.     for <kermit.misc@watsun.cc.columbia.edu>; Mon, 18 Oct 1999 00:56:28 -0400 (EDT)
  5. Received: (from news@localhost)
  6.     by newsmaster.cc.columbia.edu (8.8.5/8.8.5) id AAA22760
  7.     for kermit.misc@watsun.cc.columbia.edu; Mon, 18 Oct 1999 00:55:55 -0400 (EDT)
  8. X-Authentication-Warning: newsmaster.cc.columbia.edu: news set sender to <news> using -f
  9. Subject: [Q] how to take an action on closing network connection OR redefine a command
  10. From: Matt Swift <swift@alum.mit.edu>
  11. Message-ID: <m2ln91jmj0.fsf@aleph.swift.xxx>
  12. Date: 18 Oct 1999 00:55:15 -0400
  13. Organization: Shore.Net/Eco Software, Inc; (info@shore.net)
  14. To: kermit.misc@columbia.edu
  15.  
  16.  
  17. I want to use kermit to telnet to certain remote hosts via a local
  18. port forwarded by ssh ("tunnelling").  Suppose I want to telnet to my
  19. isp at shell.isp.com, and suppose I've defined `login' as a kermit
  20. macro which supplies user and password.  This macro would bring up a
  21. normal, insecure connection:
  22.  
  23. define isp -
  24.   set host shell.isp.com,-
  25.   login,-
  26.   connect
  27.  
  28. Now I want to redefine `isp' so that I can use it in the same way but
  29. it uses the tunelling method.  Suppose I write a shell script `tunnel'
  30. that will establish the tunnel before exiting.
  31.  
  32. define isp,-
  33.   run tunnel start isp,-
  34.   set host localhost:9000 /telnet,-
  35.   login,-
  36.   connect
  37.  
  38. This works just fine, except that the tunnel must be shut down
  39. manually.  I would like to improve this macro so that the tunnel will
  40. be closed (by taken the action `run tunnel stop isp') automatically
  41. when kermit closes the connection.  I do not see that there is any
  42. direct way to do this with kermit, so I thought of redefining
  43. the `close' command.  Unfortunately it does not seem possible.  I tried:
  44.  
  45. assign close-orig close
  46. define close -
  47.   echo a message,-
  48.   close-orig
  49.  
  50. After this, `close' from the kermit prompt executes the command
  51. `close' as usual.  It does not execute the macro `close' that I just
  52. defined.  If I do this:
  53.  
  54. define my-close -
  55.   echo a message,-
  56.   close-orig
  57.  
  58. typing `my-close' from the kermit prompt works as expected.  But this
  59. is not elegant or convenient IMO. 
  60.  
  61. I would much appreciate any advice on how to arrange that kermit will
  62. take a definable action when a network connection is closed with
  63. `close' -- or, prefereably, when it is closed for whatever reason, but
  64. I though that this was a bit too ambitious to try to accomplish.